import json
import pickle


def load_config(filename: str) -> dict:
    """
    Load configuration from a JSON file.
    """
    with open(filename, "rb") as file:
        config = json.load(file)
    # Access specific values in the config
    model_name = config["model_name"]
    data = config["data"]
    model = config["model"]
    output = config["output"]
    return {"model_name": model_name, "data": data, "model": model, "output": output}


def model_saver(model, save_path: str) -> None:
    with open(save_path, "wb") as outp:
        pickle.dump(model, outp, pickle.HIGHEST_PROTOCOL)
